package ai.people.core.pool.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 线程池属性
 *
 * @author yuanqinglong
 * @date 2022/3/1 14:14
 */
@Data
@ConfigurationProperties(prefix = "thread.pool")
public class ThreadPoolProperties {

    /**
     * 核心池大小
     */
    private Integer corePoolSize = Runtime.getRuntime().availableProcessors() + 1;
    /**
     * 最大池大小
     */
    private Integer maxPoolSize = Runtime.getRuntime().availableProcessors() << 1;

    /**
     * 队列大小
     */
    private Integer queueSize = 1024;

    /**
     * 维持几秒钟
     */
    private Long keepAliveSeconds = 0L;
    /**
     * 池名称
     */
    private String poolName;

}
